package router

import (
	"duoke/controller/staff"
	"duoke/middleware"
	"github.com/gin-gonic/gin"
)

func LoadStaff(r *gin.Engine) {
	r.GET("/staff", staff.Index.Index)

	r.POST("staff/staff/login", staff.Staff.Login)
	// 登录授权
	miniRouter2 := r.Group("staff")
	{
		miniRouter2.Use(middleware.StaffAuth())
		miniRouter2.POST("staff/info", staff.Staff.Info)
		miniRouter2.POST("staff/update", staff.Staff.Update)
		miniRouter2.POST("screenboard/count", staff.Screenboard.Count)
		miniRouter2.POST("user/list", staff.User.List)
		miniRouter2.POST("order/list", staff.Order.List)
		miniRouter2.POST("behavior/list", staff.Behavior.List)
		miniRouter2.POST("group/list", staff.Group.List)
		miniRouter2.POST("goods/info", staff.Goods.Info)
	}
}
